package adapter;


public class Computer {
	
	private ThreePinPlug plug;
	
	public Computer(ThreePinPlug plug) {
		this.plug = plug;
	}
	
	//使用三孔插座充电
	public void charge() {
		plug.powerWithThree();
	}
	
	public static void main(String[] args) {
		TwoHoleOutlet twoHoleOutlet = new TwoHoleOutlet();
		ThreePinPlug plug = new TwoPlugAdapter(twoHoleOutlet);
		Computer computer = new Computer(plug);
		computer.charge();
	}

}
